#ifndef UNIQUE_LABEL_QLIST_WIDGET_H
#define UNIQUE_LABEL_QLIST_WIDGET_H

#include <QListWidget>
#include <QMouseEvent>
#include <QLabel>
#include <QHBoxLayout>
#include <QException>

#include "escapable_qlist_widget.h"


class UniqueLabelQListWidget : public EscapableQListWidget
{
    Q_OBJECT

public:
    explicit UniqueLabelQListWidget(QWidget *parent = nullptr);

protected:
    void mousePressEvent(QMouseEvent *event) override;

public:
    QListWidgetItem* findItemByLabel(const QString &label);

    QListWidgetItem* createItemFromLabel(const QString &label);

    void setItemLabel(QListWidgetItem *item, const QString &label, const QColor &color = QColor());
};

#endif // UNIQUE_LABEL_QLIST_WIDGET_H
